Main.screenshotUI.connect(
'notify::screencast-in-progress',
this._onScreencastInProgressChanged.bind(this));
- }
-
- vfunc_event(event) {
- if (event.type() === Clutter.EventType.TOUCH_BEGIN ||
- event.type() === Clutter.EventType.BUTTON_PRESS)
- Main.screenshotUI.stopScreencast();
- return Clutter.EVENT_PROPAGATE;
+ this._clickGesture = new Clutter.ClickGesture();
+ this._clickGesture.set_recognize_on_press(true);
+ this._clickGesture.connect(
+ 'recognize', () => Main.screenshotUI.stopScreencast());
+ this.add_action(this._clickGesture);
}
_updateLabel() {
(o, handle) => this._onNewHandle(handle));
this._sync();
+
+ this._clickGesture = new Clutter.ClickGesture();
+ this._clickGesture.set_recognize_on_press(true);
+ this._clickGesture.connect('recognize', () => this._stopSharing());
+ this.add_action(this._clickGesture);
}
_onNewHandle(handle) {
this._sync();
}
- vfunc_event(event) {
- if (event.type() === Clutter.EventType.TOUCH_BEGIN ||
- event.type() === Clutter.EventType.BUTTON_PRESS)
- this._stopSharing();
-
- return Clutter.EVENT_PROPAGATE;
- }
-
_stopSharing() {
for (const handle of this._handles)
handle.stop();